package com.scs.application.modules.sys.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.scs.application.core.mvc.controller.CrudController;
import com.scs.application.core.query.QueryContext;
import com.scs.application.core.query.QueryContextHolder;
import com.scs.application.modules.cfg.adapter.ParameterAdapter;
import com.scs.application.modules.sys.entity.OnlineUser;
import com.scs.application.modules.sys.model.PageResult;
import com.scs.application.modules.sys.service.OnlineUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户令牌信息 前端控制器
 * </p>
 */
@RestController
@RequestMapping("/sys/online_user")
public class OnlineUserController extends CrudController<OnlineUserService, OnlineUser> {

    @Autowired
    private ParameterAdapter parameterAdapter;
    /**
     * 获取数据列表
     */
    @GetMapping("/page")
    public PageResult page() {
        QueryContext queryContext = QueryContextHolder.currentContext();
        IPage pageResult = service.page(queryContext);
        return PageResult.ok("查询成功", pageResult.getRecords(), pageResult.getTotal());
    }
}
